#include <iostream>

using namespace std;

class emptyClass {};

class structDestructClass2 {
  structDestructClass2() {}
  ~structDestructClass2() {}
};

class sdVirtualClass {
public:
  sdVirtualClass() {}
  virtual void foo() {}
  ~sdVirtualClass() {}
};

class sdVirtualDevClass : public sdVirtualClass {
  sdVirtualDevClass() {}
  virtual void foo() override {}
  virtual void foo2() {}
  ~sdVirtualDevClass() {}
};

int main(int argc, char const *argv[]) {
  // 空类的大小为1字节
  cout << "emptyClass: " << sizeof(emptyClass) << endl;
  // 构造函数和析构函数不占用类的大小
  cout << "structDestructClass2: " << sizeof(structDestructClass2) << endl;
  // 有虚函数的类的大小为8字节
  cout << "sdVirtualClass: " << sizeof(sdVirtualClass) << endl;
  //
  cout << "sdVirtualDevClass: " << sizeof(sdVirtualDevClass) << endl;

  return 0;
}
